HCL
Skip to main content  
 
   


SPRTechnote


CurrentDocument Property Accesses the Wrong Document When Used in a Form PostOpen Event

Technote Number: 1091509


Problem:
This issue was reported to Lotus Quality Engineering and has been addressed in
Notes 5.0.2c.

Excerpt from the Lotus Notes and Domino Release 5.0.2c QMU fix list (available
at http://www.notes.net):

SPR# CDCO4A8JPJ - Fix a problem where the wrong NotesUIDocument was being
returned from the Current Document property on a NotesUIWorkspace during the
PostOpen event.

The default PostOpen event for a form is programmed with a Source variable that
corresponds to the current document's NotesUIDocument object. The workaround
is to use this Source variable rather than the CurrentDocument property.

For example:

Given this usage:

Sub Postopen(Source As Notesuidocument)
Dim w As New notesuiworkspace
Dim uidoc as notesuidocument
Set uidoc=w.currentdocument
Messagebox "FieldX = " + uidoc.fieldgettext("FieldX")
End Sub

The code would be rewritten as follows:

Sub Postopen(Source As Notesuidocument)
Messagebox "FieldX = " + Source.fieldgettext("FieldX")
End Sub

To save a lot of editing, the easiest way to update your code is to simply set
the NotesUIDocument variable you are using to equal Source: Set UIDoc=Source.
See the full example below:

Sub Postopen(Source As Notesuidocument)
Dim uidoc as notesuidocument
Set uidoc=source
Messagebox "FieldX = " + uidoc.fieldgettext("FieldX")
End SubSupporting Information:

The problem still occurs when the LotusScript Debugger is turned on.
Related Documents:

More >





  Document options
Print this document
Print view

  Search
Search Advanced Search


  Fix list views

 RSS feeds   RSS
Subscribe to the fix list

  Resources
Using this database
View notices

  HCL Support
HCL Support


    About HCL Privacy Contact